<?
session_start();
include('../config.php');
//include('header.php');
require_once('../classes/class.jira.php');
include("../classes/connect.php");
ini_set('display_errors', 'Off');

if(!isset($_SESSION["Juname"])){
	 
	echo '<meta http-equiv="refresh" content="300;url=index.php">';
}

function getuser($username,$pass,$project,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;
		$query->project = $project;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryUser($query);
		$response = json_decode($array->responseBody);
		return $response;
		}
function getpriority($username,$pass,$host){
		$config->username= $username;
		$config->password= $pass;
		$config->port= "";
		$config->host= $host;

		$queryIssue = new Jira($config);
		$array=$queryIssue->queryAllPriority();
		$response = json_decode($array->responseBody);
		return $response;
		}

    function getDisplay($username,$pass,$host){
        $config->username= $username;
        $config->password= $pass;
        $config->port= "";
        $config->host= $host;

        $queryIssue = new Jira($config);
        $array=$queryIssue->getUser($username);
        $response = json_decode($array->responseBody);
        return $response;
        }
		
?>



<?$user=getuser($username,$pass,$project,$host);?>
                        
<?php
$arr_out=array();
foreach($user as $key){	+
     $arr_out[]= $key->displayName;    
   // $arr_out[]=$key->displayName;
        //echo $key->displayName;
}
echo json_encode($arr_out);
?>	
				